{% extends "base.html" %}
{% block title %} Список грузов {% endblock %}

{% block css-js %}
{#    {% load static %}#}
{#    <script src="{% static '' %}"></script>#}
{% endblock %}

{% block content %}

    <div class="centered m-3">

        <a type="button" class="btn btn-info m-2" href="{% url "cargo_new" %}">Добавить новый груз</a>

        <table class="table border border-dark">
        <thead>
        <tr>
            <th scope="col">pick_up</th>
            <th scope="col">deliver</th>
            <th scope="col">cargo_weight</th>
            <th scope="col">description</th>
        </tr>
        </thead>
        <tbody>
        <div class="card, overflow-y-scroll tabindex=0 ">
            <ul class="card-text" id="my-table" data-bs-spy="scroll" data-bs-target="#navbar-example3" data-bs-offset="0" tabindex="0">
                {% for foo in cargos %}
                    <tr>
                        <td><a href="../cargo_view/{{ foo.pk }}/">{{ foo.pick_up_location }}</a></td>
                        <td>{{ foo.deliver_location }}</td>
                        <td>{{ foo.cargo_weight }}</td>
                        <td>{{ foo.description }}</td>
                        <td>{{ foo.cars }}</td>
                    </tr>
                {% endfor %}
                </ul>
            </div>
            </tbody>
        </table>
    </div>

{% endblock %}